unit TabelaMercadoriasServicos;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Mask, Buttons;

type
  TFormTabelaMercadoriasServicos = class(TForm)
    Label1: TLabel;
    MaskEdit1: TMaskEdit;
    Label2: TLabel;
    MaskEdit2: TMaskEdit;
    Label3: TLabel;
    Edit1: TEdit;
    BitBtn1: TBitBtn;
    procedure BitBtn1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FormTabelaMercadoriasServicos: TFormTabelaMercadoriasServicos;

implementation

uses principal, Retorno, funcoesapoio, declaracoes;

{$R *.dfm}

procedure TFormTabelaMercadoriasServicos.BitBtn1Click(Sender: TObject);
begin
        FormPrincipal.Statusbar1.Panels[0].Text:='Tabelas de Mercadorias e Serviços'; WaitProcess;
        Resposta:= ECF_TabelaMercadoriasServicos3404('C:\SWEDA\SAIDA.TXT',MaskEdit1.Text, MaskEdit2.Text);

        FormPrincipal.Memo1.Lines.Add('Tabelas de Mercadorias e Serviços:'+inttostr(Resposta));
        FormPrincipal.Memo1.Lines.Add('');

        if Resposta = 1 then
        if MessageDlg('Deseja abrir o arquivo '+Edit1.Text+' ?', mtConfirmation, [mbYes, mbNo], 0) = mrYes then begin
                FormPrincipal.OpenDialog1.FileName:=Edit1.Text ;
                FormPrincipal.OpenDialog1.Execute;
                FormRetorno.Caption:=FormPrincipal.OpenDialog1.FileName;
                FormRetorno.RichEdit1.Lines.LoadFromFile(FormPrincipal.OpenDialog1.FileName);
                FormRetorno.Show;
        end;

        VerificaRetornoFuncao(Resposta);
        Refresh;

end;

end.
